<div class="text-center py-10">
  <h1 class="title-decorator inline-block text-left">
    <%= t("decidim.verifications.postal_letter.authorizations.edit.title") %>
  </h1>
</div>

<% if authorization.letter_sent? %>
  <%= decidim_form_for(@form, url: authorization_path, method: :put) do |form| %>
    <%= form_required_explanation %>

    <div class="form__wrapper">
      <%= form.text_field :verification_code, placeholder: "XXXXXX" %>
    </div>

    <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
      <%= link_to authorizations_back_path(current_user, redirect_url:), class: "button button__sm md:button__lg button__text-secondary" do %>
        <%= icon "arrow-left-line", class: "fill-current" %>
        <span><%= t("decidim.wizard_step_form.wizard_aside.back") %></span>
      <% end %>
      <button type="submit" class="button button__sm md:button__lg button__secondary">
        <span><%= t("decidim.verifications.postal_letter.authorizations.edit.send") %></span>
        <%= icon "arrow-right-line", class: "fill-current" %>
      </button>
    </div>
  <% end %>
<% else %>
  <div class="my-10">
    <%= cell("decidim/announcement", t("decidim.verifications.postal_letter.authorizations.edit.waiting_for_letter")) %>
  </div>

  <div class="form__wrapper-block">
    <%= link_to authorizations_back_path(current_user, redirect_url:), class: "button button__sm md:button__lg button__text-secondary" do %>
      <%= icon "arrow-left-line", class: "fill-current" %>
      <%= t("decidim.wizard_step_form.wizard_aside.back") %>
    <% end %>
  </div>
<% end %>
